package com.bolt.support.sqlconfig.dialect;

/**
 * Created by Administrator on 2021/4/22.
 */
public class PagingPostgreSqlDialect extends PagingDialect {

    @Override
    public String getLimitString(String sql, long offset, long limit) {
        StringBuilder stringBuilder = new StringBuilder(sql);
        stringBuilder.append(" limit ");
        if(offset > 0){
            stringBuilder.append(Long.toString(limit)).append(" offset ").append(Long.toString(offset));
        }else{
            stringBuilder.append(Long.toString(limit));
        }
        return stringBuilder.toString();
    }
}

 